﻿@{ 
    var controller = ViewContext.RouteData.Values["controller"].ToString();
    var action = ViewContext.RouteData.Values["action"].ToString();
}

<ul class="nav nav-pills nav-stacked">
    <li @if (controller == "Home") { <text> class="active" </text> }><a asp-action="Index" asp-controller="Home">首页</a></li>
    <li @if (controller == "User") { <text> class="active" </text> }><a asp-action="Index" asp-controller="User">用户管理</a></li>
    <li @if (controller == "Content") { <text> class="active" </text> }><a asp-action="Index" asp-controller="Content">内容管理</a></li>
</ul>